<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.longtop.com/intelliweb" prefix="e"%>
<%@page isELIgnored="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>机构群组管理</title>
	</head>
	<e:View id="eView">
		<script language="JScript.Encode" src="<%=request.getContextPath()%>/js/perform/fp_commonQuery.js"></script>	
			
		<div id="Invisual Controls" style="min-height: 40px; background-color: LemonChiffon;">
			<e:Dataset id="Dataset_OrgTeam" pageSize="10" loadDataCommand="Command_load" datasetDefinition="DatasetDefinition_sys.dsd" datasetRef="Dataset_OrgTeam">
				<e:Field name="orgTeamId" dataType="string" label="ID" maxLength="32" visible="false"/>
				 <e:Field name="orgTeamName" dataType="string" label="机构群组名称" maxLength="100" required="true"/>
				 <e:Field name="sortNo" dataType="integer" label="排序号" maxLength="10"  required="true"/>
				 <e:Field name="remark" dataType="string" label="  备  注  " maxLength="400" />
				 <e:Field name="createUserId" dataType="string" label="创建人ID" maxLength="32" visible="false"/>
				 <e:Field name="createUserName" dataType="string" label="创建人名称" maxLength="100" readOnly="true"/>
				 <e:Field name="createOrgId" dataType="string" label="创建机构ID" maxLength="32" visible="false"/>
				 <e:Field name="createOrgName" dataType="string" label="创建机构名称" maxLength="100"  readOnly="true"/>
				 <e:Field name="orgLevelCode" dataType="string" label="机构级次" maxLength="100" readOnly="true" visible="false"/>
				 <e:Field name="createTime" dataType="timestamp" label="创建时间" maxLength="26" readOnly="true"/>
				 <e:Field name="updateUserId" dataType="string" label="修改人ID" maxLength="32" visible="false"/>
				 <e:Field name="updateUserName" dataType="string" label="修改人名称" maxLength="100"/>
				 <e:Field name="updateTime" dataType="timestamp" label="修改时间" maxLength="26" visible="false"/>
			</e:Dataset>
			
			<e:Command id="Command_search" action="com.longtop.framework.sys.team.web.OrgTeamAction" method="queryTeam" submitForm="true" showHintInfoOnSuccess="false">
				<e:DatasetInfo name="DatasetInfo1" dataset="Dataset_OrgTeam" alwayRefreshClient="true" />
			</e:Command>
			<e:Command id="Command_load" action="com.longtop.framework.sys.team.web.OrgTeamAction" method="loadTeam" submitForm="true" showHintInfoOnSuccess="false" >
			</e:Command>
			<e:Command id="Command_save" action="com.longtop.framework.sys.team.web.OrgTeamAction" method="saveTeam">
				<e:DatasetInfo name="DatasetInfo1" dataset="Dataset_OrgTeam" />
			</e:Command>
		</div>
		
		<e:Page id="ePage" action="com.longtop.framework.sys.team.web.OrgTeamAction" onAfterLoadPage="ePage_onAfterLoadPage()" style="width:100%;height:400px">
			<body>
				<table width="100%" height="100%">
					<tr>
						<td valign="top" style="width: 100% height :90%" align="left">
							<table width="100%" height="100%">
								<tr>
									<td align="left" colspan="1">
										<e:GroupBox id="group_custInfo" style="width: 100%; " caption="机构群组查询">
											<table width="100%" border="0">
												<tr>										
													<td align="right">群组名称 :</td>
													<td align="left"><e:Text id="Text_orgTeamName" style="width: 150px;" /></td>
													<td>
														<e:Button id="Button3" caption="查询" style="height: 20px; width: 70px" icon="/images/query.gif" command="Command_search" />&nbsp; 
														<e:Button id="Button_reset" style="height: 20px; width: 70px" caption="重置" onClick="resetQueryCondition();" icon="/images/refresh.gif"></e:Button> 
														<e:Text id="custType" style="width: 0px;" />
													</td>
												</tr>
											</table>
										</e:GroupBox>
									</td>
								</tr>
								<tr height="30px">
									<td>
										<table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td height="27px" width="1%">
													<e:RecordNavigator id="RecordNavigator_User" dataset="Dataset_OrgTeam" showNavigatorButton="false">
														<e:RecordButton id="RecordButton_Insert" label="新增群组" onClick="insertRecord" icon="/images/add.gif"></e:RecordButton>
														<e:RecordButton id="RecordButton_Delete" label="删除" onClick="deleteRecord" icon="/images/delete.gif"></e:RecordButton>
														<e:RecordButton id="RecordButton_save" label="保存" icon="/images/submit.gif" onClick="RecordButton_save_onClick()"></e:RecordButton>
														<e:RecordButton id="RecordButton_Edit" label="关联机构" onClick="RecordButton_Edit_onClick()" icon="/images/position.gif"></e:RecordButton>
													</e:RecordNavigator>
												</td>
												<td align="left" width="99%"><e:PageNavigator id="PageNavigator" dataset="Dataset_OrgTeam" showRecordNum="true"></e:PageNavigator></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td valign="top" align="left" colspan="1">
										<e:Grid id="Grid_result" dataset="Dataset_OrgTeam" readOnly="false" style="width:100%;height:325px;" showIndex="true" allowDragColumn="false" allowResizeColumn="true" showIndicator="true">						
										</e:Grid>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</body>
		</e:Page>
	</e:View>
	
<script type="text/javascript">
	function ePage_onAfterLoadPage(){
	
	}
	
	//提交保存
	function RecordButton_save_onClick(){
		reloadWin = function (){
			window.location.reload();
		}		
		var flag = Command_save.execute();
		if(flag){
			var msg=Command_save.getResponseMessage();
			MsgBox.showInfoMsg(msg,"",[reloadWin]);
		}
	}
	
	//关联用户
	function RecordButton_Edit_onClick(){
		var dataset = $J(Dataset_OrgTeam);
	    var recordCurrent = dataset.getCurrentRecord();
	    if(!recordCurrent){
	    	MsgBox.showInfoMsg("请选择一个机构群组。");
	   	    return;
	    }
	    var orgTeamId = recordCurrent.getValue("orgTeamId");
	    if(orgTeamId == "" || orgTeamId == null){
	    	MsgBox.showInfoMsg("请先保存当前新建的群组。");
	   	    return;
	    }	  
	    var orgTeamName;
  		if(recordCurrent.getValue("orgTeamName")!=null&&recordCurrent.getValue("orgTeamName")!=""){
  			orgTeamName =Util.encode(recordCurrent.getValue("orgTeamName"));
  		}
	    	
	    var path = "/jsp/framework/sys/team/orgTeamMx.jsp?orgTeamId="+orgTeamId+"&orgTeamName="+orgTeamName;
		parent.TabUtil.openTab("orgTeamMx","机构群组关联",path,true);
	
	}	
</script>

</html>